home *** CD-ROM | disk | FTP | other *** search
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta NAME="Author,Design" Content="GateKeeper Team; gatekeeper@infopulse.net">
- <meta NAME="Copyright" Content="Infopulse; www.infopulse.net">
- <title>Empty</title>
- </head>
-
- <body>
- <%
- bValidPwd = True
-
- If Request.ReqParam("name") = "" Then
- Set user = Accounts.Users.NewUser
- NewUser = TRUE
- Else
- If Request.ReqParam("newuser") = "True" Then
- Set user = Accounts.Users.NewUser
- user.Name = Request.ReqParam("name")
- NewUser = TRUE
- Else
- Set user = Accounts.Users.item(Request.ReqParam("name"))
- NewUser = FALSE
- End If
- End If
-
- If Request.ReqParam("action") = "Remove" AND Not NewUser = TRUE Then
- On Error Resume Next
- user.Remove
- If Not Err.Number = 0 Then
- ErrLine = Err.Description
- Else
- Response.Redirect("users.agp")
- End If
- ElseIf Request.ReqParam("action") = "Commit" Then
- ' Process the user account
- If Request.ReqParam("CanChangePwd") = "True" Then
- user.CanChangePassword = TRUE
- Else
- user.CanChangePassword = FALSE
- End If
- If Request.ReqParam("MustChangePwd") = "True" Then
- user.MustChangePassword = TRUE
- Else
- user.MustChangePassword = FALSE
- End If
- If Request.ReqParam("Enabled") = "True" Then
- user.Enabled = TRUE
- Else
- user.Enabled = FALSE
- End If
- user.RealName = Request.ReqParam("realname")
- user.Description = Request.ReqParam("description")
-
- sPwd = Request.ReqParam("password")
- sTestPwd = Request.ReqParam("testPassword")
- if sPwd <> sTestPwd Then
- bValidPwd = False
- Else
- user.Password = sPwd
- End If
-
- ' Process the grouplist
- Dim grouplist()
- groupline = Request.ReqParam("groups")
- grouplistidx = 1
- While Len(groupline)
- pos = InStr(groupline,",")
- If pos > 0 Then
- groupitem = Left(groupline,pos - 1)
- groupline = Mid(groupline,pos + 1)
- Else
- groupitem = groupline
- groupline = ""
- End If
- ReDim Preserve grouplist(grouplistidx+1)
- grouplist(grouplistidx) = groupitem
- grouplistidx = grouplistidx + 1
- Wend
-
- Set groups = Accounts.Groups
- For groupcnt = 1 to groups.count
- Set group = Accounts.Groups.Item(groupcnt)
-
- bIsMemberOfThisGroup = FALSE
- For listcnt = 1 to grouplistidx-1
- If grouplist(listcnt) = group.name Then
- bIsMemberOfThisGroup = TRUE
- End If
- Next
-
- If group.IsMember(user.name) AND Not bIsMemberOfThisGroup = TRUE Then
- group.DelMember(user.name)
- group.Commit
- ElseIf Not group.IsMember(user.name) AND bIsMemberOfThisGroup = TRUE Then
- group.AddMember(user.name)
- group.Commit
- End If
-
- Next
-
- if bValidPwd Then
- On Error Resume Next
- user.Commit
- If Not Err.Number = 0 Then
- ErrLine = Err.Description
- Else
- Response.Redirect("users.agp")
- End If
- Else
- %>
- <B><FONT COLOR="#FF0000">
- The password was not confirmed correctly !
- </FONT></B>
- <br>
- <%
- End if
- End If
- If Not NewUser Then
- %>
- <p><big><strong><font face="Arial">
- Edit user account
- </font></strong></big></p>
- <%
- Else
- %>
- <p><big><strong><font face="Arial">
- Add new user account
- </font></strong></big></p>
- <%
- End If
-
- If Not Len(ErrLine) = 0 Then
- Response.Write("<B><FONT COLOR=""#FF0000"">" & ErrLine & "</FONT></B><br>")
- End If
- %>
-
- <form method="POST" action="/accounts/useredit.agp">
- <input type="hidden" name="newuser" value="<%Response.Write(NewUser)%>">
- <div align="center"><center>
- <table border="1" cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td width="40%" bgcolor="#183159"><strong><font face="Arial" color="#FFFFFF">
- Option
- </font></strong></td>
- <td width="40%" bgcolor="#183159"><strong><font face="Arial" color="#FFFFFF">
- Value
- </font></strong></td>
- </tr>
- <tr>
- <td width="40%" title="Fill in with logon names like: jsmith, john.doe, and so on."><strong><font face="Arial">
- User name
- </font></strong></td>
- <td width="40%">
- <%
- If NewUser Then
- %>
- <input type="text" size="20" name="name" value="<%Response.Write(user.name)%>">
- <%
- Else
- %>
- <input type="hidden" name="name" value="<%Response.Write(user.name)%>">
- <%Response.Write(user.name)%>
- <%
- End If
- %>
- </td>
- </tr>
- <tr>
- <td width="40%"><strong><font face="Arial">
- Password
- </font></strong></td>
- <td width="40%"><input type="password" size="20" name="password" value="<%Response.Write(user.password)%>"></td>
- </tr>
- <tr>
- <td width="40%"><strong><font face="Arial">
- Confirm password
- </font></strong></td>
- <td width="40%"><input type="password" size="20" name="testPassword" value="<%Response.Write(user.password)%>"></td>
- </tr>
- <tr>
- <td width="40%"><strong><font face="Arial">
- Full name
- </font></strong></td>
- <td width="40%"><input type="text" size="40" name="realname" value="<%Response.Write(user.realname)%>"></td>
- </tr>
- <tr>
- <td width="40%"><strong><font face="Arial">
- Description
- </font></strong></td>
- <td width="40%"><input type="text" size="40" name="description" value="<%Response.Write(user.description)%>"></td>
- </tr>
- <tr>
- <td width="40%" title="If the checkbox is unchecked the account cannot be used."><strong><font face="Arial">
- Enabled
- </font></strong></td>
- <td width="40%"><input type="checkbox" <% If user.Enabled Then Response.Write("Checked ") End If %> name="Enabled" value="True"></td>
- </tr>
- <tr>
- <td width="40%"><strong><font face="Arial">
- The user can change the password
- </font></strong></td>
- <td width="40%"><input type="checkbox" <% If user.CanChangePassword Then Response.Write("Checked ") End If %> name="CanChangePwd" value="True"></td>
- </tr>
- <tr>
- <td width="40%"><strong><font face="Arial">
- The user must change the password at next logon
- </font></strong></td>
- <td width="40%"><input type="checkbox" <% If user.MustChangePassword Then Response.Write("Checked ") End If %> name="MustChangePwd" value="True"></td>
- </tr>
- </table>
- </center></div>
- <br>
- <font face="Arial">
- <%
- Set groups = Accounts.Groups
- groupcount = 1
- if groups.count > 0 Then
- if NewUser = TRUE Then
- Response.Write("This user will be a member of the following groups:")
- Else
- Response.Write("This user is a member of the following groups:")
- End If
- %>
- <table border="0" width="100%">
- <%
- End if
- While Not groupcount > groups.count
- %>
- <tr>
- <%
- For subcount = 0 to 3
- %>
- <td width="25%">
- <%
- If Not groupcount > groups.count Then
- Set group = groups.item(groupcount)
- Response.Write("<input type=""checkbox"" ")
- If group.IsMember(user.name) Then
- Response.Write("Checked ")
- End If
- if ( group.name = "Users" And NewUser = TRUE ) Then
- Response.Write("name=""groups"" value="""&group.name&""" checked>")
- Else
- Response.Write("name=""groups"" value="""&group.name&""">")
- End If
- Response.Write(group.name)
- End If
- groupcount = groupcount + 1
- %>
- </td>
- <%
- Next
- %>
- </tr>
- <%
- WEnd
- %>
- </table>
- <p><input type="submit" name="action" value="Commit">
- <%
- If Not NewUser = TRUE Then
- %>
- <input type="submit" name="action" value="Remove">
- <%
- End If
- %>
- </p>
- </form>
- </font>
- <p><br>
- <font size="1" face="Arial"><%Response.Write(GateKeeper.Version)%></font>
- </p>
- </body>
- </html>
-